<?php
include_once "xAP-functions/webincludes.php";
$id=intval($_GET["id"]);
$elid=intval($_GET["elid"]);


$help[0]=array("title"=>"Getting Started","desc"=>"The left hand side of the screen shows all the elemnts of this event. Each element will send a xAP message has various options that you can set.<BR>
Click add new to get started or click on an existing element to edit");

$help[1]=array("title"=>"Editing","desc"=>"If you are starting with a new element you will be presented with a list of available options. Find the one you want and click on it, you will then be presented with the various options to fill in.<BR>");


//show possible inserts from linked sources
if ($elid>0){
	$sql="SELECT  xap_eventsource.LastPassThrough FROM xap_eventsource
	INNER JOIN xAP_eventlink on xAP_eventlink.eventsourceID=xap_eventsource.eventsourceID
	INNER JOIN xAP_event on xAP_event.eventID=xAP_eventlink.eventID
	INNER JOIN xAP_eventelement on xAP_event.eventID=xAP_eventelement.eventID
	where xAP_eventelement.EventElementID=".$elid."
	";
	$results=dbquery($sql);
	$elements=unserialize($results[0]["LastPassThrough"]);

	
}
?>
<span  class='boldtext'><?=$help[$id]["title"]?></span><BR><BR>
<span class='normaltext'><?=$help[$id]["desc"]?></span>

<? if(isset($elements)):?>
	<span  class='boldtext'>Insertable Items</span><BR>
	<table>
	<? foreach($elements as $k=>$v):?>
		
		<tr><TD class='boldtext'>##<?=$k ?>##</TD>
		<TD class='normalsmalltext'><?=strip_tags($v) ?></TD></tr>
	
	<?endforeach;?>
	</table>
<? endif;?>